import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

public class Demo6724 {

    public static void main(String[] args) {
    //使用自然排序
    List<Course6724> list=getCourses();
	
   Collections.sort(list,(c1,c2)->c1.getTerm().compareTo(c2.getTerm()));
    
    for (Course6724 c : list) {
      System.out.println(c);
    }
  }
  
	private static List<Course6724> getCourses() {
		// 使用数组保存一组对象
		List<Course6724> courses = new ArrayList<Course6724>();
		
		Course6724 c1 = new Course6724("A001", "C程序设计基础", "1上", 4, 80);
		Course6724 c2 = new Course6724("B002", "Pthon程序基础", "1下", 2, 85);
		Course6724 c3 = new Course6724("A002", "面向对象程序设计", "2上", 3, 78);
		Course6724 c4 = new Course6724("C001", "Java程序高级开发", "3上", 2, 83);
		Course6724 c5 = new Course6724("C002", "软件工程与UML", "3下", 3, 75);
		Course6724 c6 = new Course6724("B001", "操作系统", "2下", 3, 90);
		Course6724 c7 = new Course6724("A003", "数据库原理", "2上", 3, 78);
		Course6724 c8 = new Course6724("B003", "网络基础", "3上", 3, 75);
		Course6724 c9 = new Course6724("0001", "大学英语", "1上", 3, 80);
		Course6724 c10 = new Course6724("0002", "高等数学", "1下", 2, 85);
		
		courses.add(c1);
		courses.add(c2);
		courses.add(c3);
		courses.add(c4);
		courses.add(c5);
		courses.add(c6);
		courses.add(c7);
		courses.add(c8);
		courses.add(c9);
		courses.add(c10);
		
		return courses;
	}
}
